package com.yc.vcode.web;

import com.yc.bean.Result;
import com.yc.vcode.VcodeException;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class ExHandler {
    @ExceptionHandler
    @ResponseBody
    Object handleVcodeException(VcodeException e){
        return new Result(0,e.getMessage(),null);
    }
}
